Class InventoryObject
Represents the properties of an object as it appears in the inventory.
Members
nameKey | (string) string key for the item's (localised) name. |
slot | (InvItem) slot of item whose inventory display properties you wish to change |
yOffset | (float) y-axis offset (positive values will move the item lower). |
scale | (float) Item's size when displayed in the inventory as a multiple of its "regular" size. |
rot | (Rotation) Item's rotation about its origin when displayed in the inventory. |
rotAxisWhenCurrent | (RotationAxis) Axis to rotate about when the item is being looked at in the inventory. |
meshBits | (int) Not currently implemented (will have no effect regardless of what you set it to) |
action | (ItemAction) What can the player do with the item? |
Functions
InventoryObject.new() | Create an inventoryObject item. |
InventoryObject.new(nameKey, slot, yOffset, scale, rot, rotAxisWhenCurrent, meshBits, action) | For more information on each parameter, see the associated getters and setters. |
Members
- nameKey
- (string) string key for the item's (localised) name. Corresponds to an entry in strings.lua.
- slot
- (InvItem) slot of item whose inventory display properties you wish to change
- yOffset
- (float) y-axis offset (positive values will move the item lower). A value of about 100 will cause the item to display directly below its usual position.
- scale
- (float) Item's size when displayed in the inventory as a multiple of its "regular" size. A value of 0.5 will cause the item to render at half the size, and a value of 2 will cause the item to render at twice the size.
- rot
- (Rotation) Item's rotation about its origin when displayed in the inventory.
- rotAxisWhenCurrent
-
(RotationAxis) Axis to rotate about when the item is being looked at in the inventory.
Note that this is entirely separate from the rot field described above.
Must be RotationAxis.X, RotationAxis.Y or RotationAxis.Z.
e.g.
myItem.rotAxisWhenCurrent = RotationAxis.X
- meshBits
- (int) Not currently implemented (will have no effect regardless of what you set it to)
- action
-
(ItemAction) What can the player do with the item?
Must be one of:
EQUIP USE EXAMINE
e.g.
myItem.action = ItemAction.EXAMINE
Functions
- InventoryObject.new()
-
Create an inventoryObject item. Use this if you want to specify property values later later.
The default property values are not disclosed here, since at the time of writing, they are subject to change.
Returns:
-
an InventoryObject
- InventoryObject.new(nameKey, slot, yOffset, scale, rot, rotAxisWhenCurrent, meshBits, action)
-
For more information on each parameter, see the
associated getters and setters.
Parameters:
- nameKey string name key
- slot InvItem slot of inventory object to change
- yOffset int y-axis offset (positive values move the item down)
- scale float item size (1 being standard size)
- rot Rotation rotation about x, y, and z axes
- rotAxisWhenCurrent RotationAxis axis to rotate around in inventory
- meshBits int not currently implemented
- action ItemAction is this usable, equippable, or examinable?
Returns:
-
an InventoryObject